<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>SHUMedia</title>

        <?php echo $styleSheets; ?>

        <script type="text/javascript">
            var baseurl = '<?php PrintURL(); ?>';
            
            var registeredOnLoad   = [];
            var registeredOnUnload = [];

            function registerOnLoadFunction(functionName) {
                registeredOnLoad.push(functionName);
            }

            function registerOnUnloadFunction(functionName) {
                registerOnUnload.push(functionName);
            }

            function callLoadFunctions() {
                for (functionNameKey in registeredOnLoad) {
                    registeredOnLoad[functionNameKey]();
                }
            }

            function callUnloadFunctions() {
                for (functionNameKey in registeredOnUnload) {
                    registeredOnUnload[functionNameKey]();
                }
            }
        </script>
        
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>

        <?php echo $scripts; ?>

    </head>
    
    <body onLoad="callLoadFunctions();" onUnload="callUnloadFunctions();">
      
        <div id="header">
            <?php
                $session = Session::inst();
                if ($session->getUserid()): 
            ?>
            <span class="floatright" style=" padding-right: 20px; padding-top:10px">
                Welcome <?php echo $session->user->username; ?>
                <a href="<?php PrintURL("system", "logout"); ?>">
                    Log Out
                </a>
            </span>
            <?php  else: ?>
            <span class="floatright" style=" padding-right: 20px; padding-top:5px">
                You are not logged in :
                <!--<a href="<?php PrintURL("system", "login"); ?>">Log In</a>-->
                <div id="login" style="display:inline;">
                    <form method="post" style="display:inline;" action="<?php PrintURL("system", "login"); ?>">
                        <label for="username">Username: </label><input type="text" name="username" />
                        <label for="password">Password: </label><input type="password" name="password" />
                        <input type="submit" value="Login"/>
                    </form>
                </div>
            </span>
            <?php endif; ?>
        </div>
        
        <div id="bodycontainer">
            <!--  Title and stuff -->
           <ul id="navbar">
               <li class="main">
                   <a href="<?php PrintURL("Home", "Main"); ?>" class="main_link">
                       <span class="down">Home</span>
                   </a> 
               </li>
               <li class="main">
                   <a href="#nogo2" class="main_link">
                       <span class="down">SHU-Radio</span>
                   </a>
                   <ul class="sub">
                        <li>
                            <a  href="#nogo4" class="fly" >Podcasts</a>
                            <ul>
						<li>
                                                    <a href="#nogo4">The Decree</a>
                                                </li>
						<li>
                                                    <a href="#nogo5">Fan Talk</a>
                                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="#nogo4">News</a>
                        </li>
                        <li>
                            <a href="#nogo4">Get Involved</a>
                        </li>
                        <li>
                            <a href="#nogo5" class="fly" >Contact us</a>
                            <ul>
						<li>
                                                    <a href="#nogo4">Facebook</a>
                                                </li>
						<li>
                                                    <a href="#nogo5">Twitter</a>
                                                </li>
						<li>
                                                    <a href="#nogo6">Details</a>
                                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="<?php PrintURL("About", "SHURadio"); ?>">About</a>
                        </li>
                   </ul>
               </li>
               <li class="main">
                   <a href="#nogo2" class="main_link">
                       <span class="down">SHU-Box</span>
                   </a>
               </li>
            </ul> 
            <div id="maincontainer">
                <?php
                foreach ($views as $view) {
                    echo ($view);
                }
                ?>
            </div>

            <div id="footer">&copy; SHUMedia 2011</div>
        </div>
    </body>
</html>